package com.wave.wavesystem.ai.service.impl;

import com.mybatisflex.core.query.QueryChain;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.wave.wavesystem.ai.mapper.RagPostChunkMapper;
import com.wave.wavesystem.ai.pojo.entity.RagPostChunk;
import com.wave.wavesystem.ai.pojo.query.RagPostChunkQuery;
import com.wave.wavesystem.ai.service.IRagPostChunkService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class RagPostChunkServiceImpl extends ServiceImpl<RagPostChunkMapper, RagPostChunk>
        implements IRagPostChunkService {

    @Override
    public QueryChain<RagPostChunk> getQueryChain(RagPostChunkQuery query) {
        QueryChain<RagPostChunk> queryChain = this.queryChain();
        return queryChain;
    }

    @Override
    public List<RagPostChunk> searchHybrid(String kw, byte[] vec, int topK) {
        return this.mapper.searchHybrid(kw, vec, topK);

    }


}
